<?php

namespace IDock\Insurance\TPIC\Response;

use IDock\Http\Response;
use IDock\Insurance\TPIC\Response\AllTPICResponse;
use IDock\Printer\PolicyPaymentPrinter;

class ElectronicSignResponse extends AllTPICResponse
{

    public $printer = PolicyPaymentPrinter::class;

    public function printerInit(): Response
    {
        $data = $this->getBody();
        $this->printer->payUrl = $data['body']['sign']['url'] ?? '';
        if(!empty($this->printer->payUrl)){
            $this->printer->payUrl = str_replace('&amp;','&',$this->printer->payUrl);
        }
        return $this;
    }

}
